import React from 'react';
import {StyleSheet, View, Text, Button, Alert} from 'react-native';

export default class AlertTest extends React.Component {
  constructor(props) {
    super(props)
  }
  
  onPressHandle() {
    console.log('弹框', Date.now())
    Alert.alert(
      'Alert Title',
      'My Alert Msg',
      [
        {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
        {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
        {text: 'OK', onPress: () => console.log('OK Pressed')},
      ],
      { cancelable: false }
    )
  }

  render() {
    return (
      <View>
        <Button title="弹框" onPress={this.onPressHandle.bind(this)}></Button>
      </View>
    )
  }
}